<template>
  <div v-if="showItem">
    <div class="newsDetail">
      <div class="banner">
        <div class="bannerMain">
          <p>
            <span>
              {{ item.newsTageName }}
            </span>
            <span>
              {{ item.newsTageEg }}
            </span>
          </p>
          <p>
            {{ item.newsTageDsc }}
          </p>
        </div>
      </div>
      <div class="newsMain">
        <div class="newsLeft" v-for="items in item.newsLeft">
          <div>
            <p class="newsTitle">
              <span>
                {{ items.newsTitle }}
              </span>
            </p>
            <p class="newsInfo">
              <span>
                {{ items.newsInfo }}
              </span>
              <span>
                <span>
                  {{ items.author }}
                </span>
                <span>
                  {{ items.authorName }}
                </span>
              </span>
            </p>
            <div class="line"></div>
            <div class="contents">
              <div v-for="co in items.contents">
                <p>
                  {{ co.txt }}
                </p>
                <p>
                  <br />
                </p>
              </div>
            </div>
          </div>
          <div>
            <div class="lineBottom"></div>
            <div class="prevNext">
              <div v-for="pr in items.prevNext">
                <router-link
                  :to="{
                    path: 'newsDetail',
                    query: { id: items.id },
                  }"
                >
                  <span>
                    {{ pr.title }}
                  </span>
                  <span>
                    {{ pr.dsc }}
                  </span>
                </router-link>
              </div>
            </div>
          </div>
        </div>
        <div
          class="newsRight"
          v-for="(nr, index) in item.newsRight"
          :key="index"
        >
          <div>
            <p class="newsTitle">相关产品</p>
            <div class="line"></div>
          </div>
          <div class="botList">
            <div v-for="(ite, index) in nr.botList">
              <router-link
                :to="{
                  path: 'botDetail',
                  query: { id: ite.id },
                }"
                tag="div"
                class="botItem"
              >
                <img :src="ite.imgUrl" />
                <div>
                  <p title="Steam礼物机器人-淘宝版" class="botTitle">
                    {{ ite.name }}
                  </p>
                  <p title="" class="botContant">
                    {{ ite.depict }}
                  </p>
                </div>
              </router-link>
            </div>
          </div>
          <div>
            <p class="newsTitle">推荐客户案例</p>
            <div class="line"></div>
          </div>
          <div class="caseList">
            <div v-for="(ca, index) in nr.caseList">
              <div class="case">
                <img :src="ca.imgUrl" />
                <div class="caseTitle">
                  <p>
                    {{ ca.name }}
                  </p>
                </div>
              </div>
            </div>
          </div>
          <div>
            <p class="newsTitle">相关阅读</p>
            <div class="line"></div>
          </div>
          <div class="relevantList">
            <div v-for="(re, index) in nr.relevantList">
              <div class="relevant">
                <img :src="re.imgUrl" />
                <div class="relevantMain">
                  <div class="relevantInfo">
                    <div class="time">
                      <span v-for="ti in re.time">
                        {{ ti.txt }}
                      </span>
                    </div>
                    <div class="share">
                      <img src="../static/weixin.png" alt="" />
                      <img src="../static/weibo.png" alt="" />
                    </div>
                  </div>
                  <div class="relevantTitle">
                    {{ re.titleDsc }}
                  </div>
                  <div class="line"></div>
                  <div class="relevantContent">
                    <div v-for="co in re.itemContent">
                      <p>
                        {{ co.txt }}
                      </p>
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      item: {},
      showItem: true,
      news: [
        {
          id: 40001,
          newsTageName: "新闻资讯",
          newsTageEg: "News",
          newsTageDsc: "行业内时事新闻",
          newsLeft: [
            {
              newsTitle: "共享游戏客户端：高效整合游戏账号资源的账号租赁系统",
              newsInfo: "2021-02-14",
              author: "作者：",
              authorName: "飞渡",
              contents: [
                {
                  txt:
                    "随着游戏产业的蓬勃发展，层出不穷的正版大作正铺天盖地地袭来。",
                },
                {
                  txt:
                    "然而，正版大作动辄数百的价格已然让玩家的钱包萧瑟不已，要是能让玩家有花更少的钱玩到更多更好的游戏的方法就好了QZQ！",
                },
              ],
              prevNext: [
                {
                  title: "上一篇:",
                  dsc: "没有了",
                },
                {
                  title: "下一篇:",
                  dsc: "什么是RPA机器人？RPA有什么好处？",
                },
              ],
            },
          ],
          newsRight: [
            {
              botList: [
                {
                  id: 200001,
                  name: "Steam饰品机器人-淘宝版",
                  depict:
                    "Steam礼物机器人(淘宝版)适用于淘宝/天猫平台游戏代购店铺自动发货，帮助商家实现24小时Steam游戏代购自动发货，和每天重复上百次的发货工作说再见。",
                  imgUrl: require("@/static/bot-1.png"),
                },
              ],
              caseList: [
                {
                  id: 200001,
                  name: "50shou电竞饰品交易平台",
                  imgUrl: require("@/static/bot-1.png"),
                },
              ],
              relevantList: [
                {
                  imgUrl: require("@/static/SteamBot.png"),
                  titleDsc:
                    "Steam批量发货机器人大更新：无需额度号，也能跨区批量发送steam礼物",
                  itemContent: [
                    {
                      txt:
                        "steam批量发货机器人可用于批量生成成品号，能够帮助商家实现高效大量囤货的机器人，减少人力成本，提高囤货效率。",
                    },
                  ],
                  time: [{ txt: "02-15" }, { txt: "2021" }],
                },
                {
                  imgUrl: require("@/static/SteamBot.png"),
                  titleDsc:
                    "Steam批量发货机器人大更新：无需额度号，也能跨区批量发送steam礼物",
                  itemContent: [
                    {
                      txt:
                        "steam批量发货机器人可用于批量生成成品号，能够帮助商家实现高效大量囤货的机器人，减少人力成本，提高囤货效率。",
                    },
                    {
                      txt:
                        "steam批量发货机器人可用于批量生成成品号，能够帮助商家实现高效大量囤货的机器人，减少人力成本，提高囤货效率。",
                    },
                  ],
                  time: [{ txt: "01-15" }, { txt: "2021" }],
                },
              ],
            },
          ],
        },
        {
          id: 40002,
          newsTageName: "新闻资讯",
          newsTageEg: "News",
          newsTageDsc: "行业内时事新闻",
          newsLeft: [
            {
              newsTitle: "什么是RPA机器人？RPA有什么好处？",
              newsInfo: "2021-03-14",
              author: "作者：",
              authorName: "飞渡",
              contents: [
                {
                  txt:
                    "随着游戏产业的蓬勃发展，层出不穷的正版大作正铺天盖地地袭来。",
                },
                {
                  txt:
                    "然而，正版大作动辄数百的价格已然让玩家的钱包萧瑟不已，要是能让玩家有花更少的钱玩到更多更好的游戏的方法就好了QZQ！",
                },
              ],
              prevNext: [
                {
                  title: "上一篇:",
                  dsc: "共享游戏客户端：高效整合游戏账号资源的账号租赁系统",
                },
                {
                  title: "下一篇:",
                  dsc: "什么是RPA机器人？RPA有什么好处？",
                },
              ],
            },
          ],
          newsRight: [
            {
              botList: [
                {
                  id: 200001,
                  name: "Steam饰品机器人-淘宝版",
                  depict:
                    "Steam礼物机器人(淘宝版)适用于淘宝/天猫平台游戏代购店铺自动发货，帮助商家实现24小时Steam游戏代购自动发货，和每天重复上百次的发货工作说再见。",
                  imgUrl: require("@/static/bot-1.png"),
                },
              ],
              caseList: [
                {
                  id: 200002,
                  name: "50shou电竞饰品交易平台",
                  imgUrl: require("@/static/bot-1.png"),
                },
              ],
              relevantList: [
                {
                  imgUrl: require("@/static/SteamBot.png"),
                  titleDsc:
                    "Steam批量发货机器人大更新：无需额度号，也能跨区批量发送steam礼物",
                  itemContent: [
                    {
                      txt:
                        "steam批量发货机器人可用于批量生成成品号，能够帮助商家实现高效大量囤货的机器人，减少人力成本，提高囤货效率。",
                    },
                  ],
                  time: [{ txt: "02-15" }, { txt: "2021" }],
                },
                {
                  imgUrl: require("@/static/SteamBot.png"),
                  titleDsc:
                    "Steam批量发货机器人大更新：无需额度号，也能跨区批量发送steam礼物",
                  itemContent: [
                    {
                      txt:
                        "steam批量发货机器人可用于批量生成成品号，能够帮助商家实现高效大量囤货的机器人，减少人力成本，提高囤货效率。",
                    },
                    {
                      txt:
                        "steam批量发货机器人可用于批量生成成品号，能够帮助商家实现高效大量囤货的机器人，减少人力成本，提高囤货效率。",
                    },
                  ],
                  time: [{ txt: "01-15" }, { txt: "2021" }],
                },
                {
                  imgUrl: require("@/static/SteamBot.png"),
                  titleDsc:
                    "Steam批量发货机器人大更新：无需额度号，也能跨区批量发送steam礼物",
                  itemContent: [
                    {
                      txt:
                        "steam批量发货机器人可用于批量生成成品号，能够帮助商家实现高效大量囤货的机器人，减少人力成本，提高囤货效率。",
                    },
                    {
                      txt:
                        "steam批量发货机器人可用于批量生成成品号，能够帮助商家实现高效大量囤货的机器人，减少人力成本，提高囤货效率。",
                    },
                  ],
                  time: [{ txt: "01-10" }, { txt: "2021" }],
                },
              ],
            },
          ],
        },
      ],
    };
  },
  created() {
    const id = this.$route.query.id;
    this.item = this.news.find((s) => String(s.id) === String(id));
  },
  watch: {
    $route: {
      handler() {
        const id = this.$route.query.id;
        if (id != undefined) {
          this.item = this.news.find((s) => String(s.id) === String(id));
        }
      },
      deep: true,
    },
  },
};
</script>

<style lang="less" scoped>
.newsDetail {
  background: #f5f5f5;
  width: 100%;
  min-height: 100vh;
  .banner {
    width: 100%;
    height: 372px;
    background-color: #2e2f3a;
    background-image: url(../static/xinwen.png);
    background-repeat: no-repeat;
    background-size: cover;
    display: flex;
    align-items: center;
    justify-content: center;
    .bannerMain {
      width: 1200px;
      p:first-child {
        font-size: 40px;
        font-family: Microsoft YaHei;
        font-weight: 700;
        color: #fff;
        span:last-child {
          font-size: 14px;
          font-family: Microsoft YaHei;
          font-weight: 400;
          color: #494b5a;
        }
      }
      p:last-child {
        font-size: 14px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #fff;
        margin-top: 35px;
        width: 500px;
      }
    }
  }
  .newsMain {
    box-sizing: border-box;
    display: flex;
    justify-content: space-between;
    width: 1200px;
    margin: 0 auto;
    padding: 60px 0 70px;
    .newsLeft {
      width: 809px;
      background: #fff;
      padding: 43px 33px 51px;
      box-sizing: border-box;
      display: flex;
      justify-content: space-between;
      flex-direction: column;
      .newsTitle {
        font-size: 22px;
        font-family: Microsoft YaHei;
        font-weight: 700;
        color: #333;
      }
      .newsInfo {
        font-size: 10px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #333;
        margin-top: 11px;
        > span:first-child {
          margin-left: 13px;
          margin-right: 10px;
          display: inline-block;
        }
      }
      .line {
        width: 700px;
        height: 1px;
        background: #e5e5e5;
        margin-top: 16px;
      }
      .contents {
        margin: 13px 0 0 0;
        font-size: 14px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #666;
        p:global {
          margin-bottom: 0;
        }
      }
      .lineBottom {
        width: 729px;
        height: 1px;
        background: #e5e5e5;
      }
      .prevNext {
        width: 100%;
        margin-top: 37px;
        font-size: 12px;
        font-family: Microsoft YaHei;
        font-weight: 400;
        color: #666;
        display: flex;
        align-items: center;
        justify-content: space-between;
        a {
          color: #333;
        }
      }
    }
    .newsRight {
      width: 369px;
      background: #fff;
      box-sizing: border-box;
      padding: 28px 20px 5px;
      .newsTitle {
        font-size: 15px;
        font-family: Microsoft YaHei;
        font-weight: 600;
        color: #282828;
      }
      .line {
        width: 328px;
        height: 1px;
        background: #e5e5e5;
        margin-top: 17px;
      }
      .botList {
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        margin-top: 15px;
        > div {
          margin-bottom: 16px;
          .botItem {
            width: 156px;
            min-height: 163px;
            background: #fff;
            border: 1px solid #e5e5e5;
            box-shadow: 0 2px 19px 2px #ddd;
            padding: 5px;
            box-sizing: border-box;
            cursor: pointer;
            > img {
              max-height: 146px;
              width: 100%;
            }
            > div {
              font-size: 10px;
              font-family: Microsoft YaHei;
              font-weight: 400;
              color: #999;
              p {
                width: 100%;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
              }
              p:first-child {
                font-size: 12px;
                font-family: Microsoft YaHei;
                font-weight: 700;
                color: #111;
                margin-top: 10px;
                margin-bottom: 6px;
              }
            }
          }
        }
      }
      .caseList {
        width: 331px;
        background: #fff;
        border-radius: 4px;
        box-shadow: 0 2px 19px 2px #ddd;
        display: flex;
        justify-content: space-between;
        flex-wrap: wrap;
        box-sizing: border-box;
        padding: 7px;
        margin-top: 17px;
        margin-bottom: 26px;
        > div {
          margin-bottom: 5px;
          .case {
            width: 156px;
            height: 94px;
            position: relative;
            cursor: pointer;
            img {
              width: 100%;
              height: 100%;
            }
            .caseTitle {
              height: 23px;
              line-height: 23px;
              width: 100%;
              background: rgba(0, 0, 0, 0.5);
              position: absolute;
              bottom: 0;
              font-size: 12px;
              font-family: Microsoft YaHei;
              font-weight: 400;
              color: #fff;
              padding-left: 7px;
              box-sizing: border-box;
            }
          }
        }
      }
      .relevantList {
        margin-top: 18px;
        > div {
          margin-bottom: 20px;
          .relevant {
            width: 329px;
            height: 115px;
            background: #fff;
            box-shadow: 0 2px 19px 2px #ddd;
            box-sizing: border-box;
            padding: 12px;
            display: flex;
            cursor: pointer;
            > img {
              width: 145px;
              height: 95px;
              margin-right: 15px;
            }
            .relevantMain {
              width: 100%;
              max-width: 138px;
              .relevantInfo {
                display: flex;
                align-items: center;
                justify-content: space-between;
                .time {
                  display: flex;
                  font-size: 16px;
                  font-family: Arial;
                  font-weight: 400;
                  color: #ccc;
                  align-items: center;
                  span:last-child {
                    font-size: 8px;
                    margin-left: 8px;
                  }
                }
                .share {
                  display: flex;
                  img {
                    width: 14px;
                    height: 14px;
                    margin-left: 5px;
                  }
                }
              }
              .relevantTitle {
                width: 100%;
                overflow: hidden;
                white-space: nowrap;
                text-overflow: ellipsis;
                font-size: 12px;
                font-family: Microsoft YaHei;
                font-weight: 700;
                color: #333;
                margin-top: 5px;
              }
              .line {
                width: 138px;
                height: 1px;
                background: #e5e5e5;
                margin-top: 8px;
              }
              .relevantContent {
                margin-top: 6px;
                width: 100%;
                height: 35px;
                overflow: hidden;
                display: -webkit-box;
                -webkit-line-clamp: 2;
                -webkit-box-orient: vertical;
                text-overflow: ellipsis;
                font-size: 11px;
                font-family: Microsoft YaHei;
                font-weight: 400;
                color: #666;
                p {
                  margin-bottom: 0;
                }
              }
            }
          }
        }
      }
    }
  }
}
</style>